//
// Created by ASUS on 2024/4/17/星期三.
//
#include <bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
	ll l,r;cin>>l>>r;
	string low=to_string(l);
	string high=to_string(r);
	int n=high.size();
	low=string(n-low.size(),'0')+low;
	vector<ll> memo(n,-1);//要加入题目中的参数
	function<ll(int,bool,bool)>dfs=[&](int i,bool limit_low,bool limit_high)->ll{
		if(i==n) return 1;
		if(!limit_low&&!limit_high&&memo[i]!=-1) return memo[i];
		ll res=0;
		int lo=limit_low?low[i]-'0':0;
		int hi=limit_high?high[i]-'0':9;
		for(int d=lo;d<=hi;d++){
			res += dfs(i + 1, limit_low && d == lo, limit_high && d == hi);
		}
		if (!limit_low && !limit_high) {
			memo[i] = res;
		}
		return res;
	};
	cout<<dfs(0,true,true);
	return 0;
}